 /*
  * 英才汇硕信息科技有限公司 拥有本软件版权 2021  并保留所有权利。
  * Copyright 2021, YCHS Information&Science Technology Co.,Ltd,
  * All rights reserved.
  */
 package com.yckj.lawyer.dongao.service;

 import com.yckj.lawyer.dongao.entity.Lawyer;
 import com.yckj.lawyer.dongao.mapper.LawyerMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;

 import java.util.List;

 /**
  * 律师业务接口实现类
  * @author liwenhao
  * @version 1.0
  */
 @Service
 public class LawyerServiceImpl implements LawyerService {
     @Autowired
     LawyerMapper lawyerMapper;

     /**
      * 修改律师
      *
      * @param lawyer 律师对象
      * @return 修改成功返回1，否则返回0
      */
     @Override
     public int modifyLawyer(Lawyer lawyer) {
         return lawyerMapper.updateLawyer(lawyer);
     }

     @Override
     public Lawyer findLawyerById(int lawyerid) {
         return lawyerMapper.selectLawyerById(lawyerid);
     }

     @Override
     public int removeLawyer(int lawyerid) {
         return lawyerMapper.deleteLawyer(lawyerid);
     }

     @Override
     public List<Lawyer> findLawyer() {
         return lawyerMapper.selectLawyer();
     }

     /**
      * 添加律师
      *
      * @param lawyer 律师对象
      * @return 添加成功返回1，否则返回0
      */
     @Override
     public int addLawyer(Lawyer lawyer) {
         return lawyerMapper.insertLawyer(lawyer);
     }
 }
